/*
 * @Description: 公共头部AppBar，自定义AppBar
 * @version: 
 * @Company: 
 * @Author: ZhengZhuang
 * @Date: 2019-08-21 17:38:44
 * @LastEditors: ZhengZhuang
 * @LastEditTime: 2019-08-23 13:42:46
 */
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class AppbarWidgetDemo extends StatefulWidget implements PreferredSizeWidget {
  String title;
  Color color;
  AppbarWidgetDemo(this.title, {this.color});
  @override
  State<AppbarWidgetDemo> createState() => _AppbarWidgetDemoState();

  @override
  Size get preferredSize {
    return new Size.fromHeight(56.0);
  }
}

class _AppbarWidgetDemoState extends State<AppbarWidgetDemo> {
  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return new Container(
      color: widget.color,
      width: ScreenUtil().setWidth(750),
      child: Container(
        margin: EdgeInsets.only(top: 20.0, left: 20.0),
        alignment: Alignment.centerLeft,
        child: Text(
          widget.title,
          style: TextStyle(color: Color(0xffffffff), fontSize: 20.0),
        ),
      ),
    );
  }
}
